/* SPDX-License-Identifier: GPL-2.0 */
#ifndef UTILS_TYPES_H
#define UTILS_TYPES_H

#include <utils/compiler.h>
#include <asm/utils/bitsperlong.h>

#ifndef __ASSEMBLY__

#include <utils/types_common.h>

#ifdef CONFIG_ARCH_PHYS_ADDR_T_64BIT
typedef u64 phys_addr_t;
#else
typedef u32 phys_addr_t;
#endif

#ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT
typedef u64 dma_addr_t;
#else
typedef u32 dma_addr_t;
#endif

typedef phys_addr_t resource_size_t;

#define S8_C(x)  x
#define U8_C(x)  x ## U
#define S16_C(x) x
#define U16_C(x) x ## U
#define S32_C(x) x
#define U32_C(x) x ## U
#define S64_C(x) x ## LL
#define U64_C(x) x ## ULL

#else

#define S8_C(x)  x
#define U8_C(x)  x
#define S16_C(x) x
#define U16_C(x) x
#define S32_C(x) x
#define U32_C(x) x
#define S64_C(x) x
#define U64_C(x) x

#endif /* !__ASSEMBLY__ */
#endif /* !UTILS_TYPES_H */
